package org.nf.web.common.converter;

import cn.hutool.core.date.DateUtil;
import org.nf.web.common.TypeConverter;

import java.util.Date;

/**
 * @Author lzp
 * @Date 2024-05-19
 */
public class DateConverter implements TypeConverter {
    @Override
    public boolean supports(Class<?> paramType) {
        return paramType.equals(Date.class);
    }

    @Override
    public Object convert(String requestParam) {
        //转换为老的API日期对象
        return DateUtil.parse(requestParam).toJdkDate();
    }
}
